<template>
  <div class="settlement-method-container">
    <div class="header">
      <h2>单据编码规则</h2>
      <div class="action-buttons">
        <el-button type="primary" @click="handleAdd">
          <el-icon><plus /></el-icon>新增
        </el-button>
        <el-button @click="handleDisable">
          <el-icon><remove /></el-icon>删除
        </el-button>
        
      </div>
    </div>

    <el-table :data="tableData" border style="width: 100%">
      <el-table-column type="selection" width="55" />
      <el-table-column label="操作" width="120">
        <template #default>
          <el-button type="text" size="small">
            <el-icon><edit /></el-icon>
          </el-button>
          <el-button type="text" size="small">
            <el-icon><delete /></el-icon>
          </el-button>
        </template>
      </el-table-column>
      <el-table-column prop="type" label="单据类型" />
      <el-table-column prop="name" label="规则名称" />
      <el-table-column prop="rule" label="编号规则" />
      <el-table-column prop="numRole" label="编号位数" />
      <el-table-column prop="startNum" label="起始编号" />
      <el-table-column prop="status" label="默认状态" width="120">
        <template #default="{ row }">
          {{ row.status ? "是" : "否" }}
        </template>
      </el-table-column>
    </el-table>

    <div class="pagination">
      <!-- <span class="total">1 - 5 共 5 条</span> -->
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import {
  Plus,
  Remove,
  Edit,
  Delete
} from '@element-plus/icons-vue'

const tableData = ref([
  { type:'购货单',name: 'GHD',rule:'GH20250616001',numRole:'3',startNum:'001', status: true },
])

const handleAdd = () => {
  console.log('新增方式')
}

const handleDisable = () => {
  console.log('删除方式')
}
</script>

<style scoped>
.settlement-method-container {
  padding: 20px;
  background-color: #fff;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.action-buttons {
  display: flex;
  gap: 10px;
}

.pagination {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

.total {
  font-size: 14px;
  color: #606266;
}

.el-table {
  margin-top: 20px;
}
</style>